<template>
  <div class='person-aside'>
    <!--个人设置-->
    <ul>
      <router-link v-for="(menu, index) in leftMenu" :key="index" tag="li" :to="menu.path"
       :class="{'aside-content':true,'selected-item':menu.sel}" active-class="selected" :disabled="!menu.sel">
        <i :class="menu.iconClass"></i>
        <a>{{menu.name}}</a>
      </router-link>
    </ul>
  </div>
</template>
<script>
import { AUTHS } from '../../assets/js/pageAuth.js'
export default {
  data() {
    return {
      Auths: AUTHS,
      url: window.creditPlatformUrl,
      username: '',
      leftMenu: [
        // {
        //   name: '基本信息',
        //   iconClass: 'iconfont icon-xinxi',
        //   path: '/sysManage/personinformation',
        //   sel: false
        //   // 页面未开发
        // },
        // {
        //   name: '重点监控企业',
        //   iconClass: 'iconfont icon-attention',
        //   path: '',
        //   sel: false
        // },
        // {
        //   name: '预警推送设置',
        //   iconClass: 'iconfont icon-tuisong',
        //   path: '/sysManage/warnPush',
        //   sel: false
        //   // 页面开发  不详功能
        // },
        // {
        //   name: '预警模型设置',
        //   iconClass: 'iconfont icon-model',
        //   path: '/sysManage/modelSetting',
        //   sel: true
        //   // 部分未开发  1
        // },
        // {
        //   name: '模型权重设置',
        //   iconClass: 'iconfont icon-yujing icon-warning',
        //   path: '/sysManage/earlyWarningAlgorithm',
        //   sel: true
        // },
        // {
        //   name: '预警规则设置',
        //   iconClass: 'iconfont icon-guize',
        //   path: '/sysManage/ruleSetting',
        //   sel: true
        //   // 部分未开发 2
        // },
        // {
        //   name: '监测网站设置',
        //   iconClass: 'iconfont icon-jiance icon-label',
        //   path: '',
        //   sel: false
        //   // 页面未开发
        // },
        {
          name: '关键词设置',
          iconClass: 'iconfont icon-guanjianciguanli',
          path: '/sysManage/keyWord',
          sel: true
        },
        {
          name: '白名单库',
          iconClass: 'iconfont icon-baimingdan',
          path: '/sysManage/whiteList',
          sel: true
        },
        // {
        //   name: '烽火值计算',
        //   iconClass: 'iconfont icon-jisuan',
        //   path: '/sysManage/taskInfo',
        //   sel: true
        //   // 搜索 筛选 未完成
        // },
        {
          name: '企业文件上传',
          iconClass: 'iconfont icon-upload',
          path: '/sysManage/filesUpload',
          sel: true
        }
      ]
    }
  },
  methods: {
    privilegeManage() {
      document.querySelector('#loginForm').submit()
    }
  },
  mounted() {
    var userInfo = JSON.parse(sessionStorage.getItem('user'))
    this.username = userInfo.realName
    // if (!this.$store.state.user.userInfo.token) {
    //   let data = this.$router.resolve({name:'login'})
    //   window.open(data.href)
    // }
    // if (this.username === 'admin') {
    //   this.leftMenu.map(item => {
    //     if (item.name === '关键词设置') {
    //       item.sel = true
    //     }
    //   })
    // }
  }
}
</script>
<style scoped lang='scss'>
.person-aside {
  flex-shrink: 0;
  min-height: 600px;
  height: calc(100vh - 95px);
  .selected-item.selected {
    color: #3f8ffa;
    a {
      color: #3f8ffa;
    }
  }
  ul {
    position: relative;
    /*height: 800px;*/
    font-size: 16px;
    color: #555;
    font-weight: bold;
    border-radius: 5px;
    .selected {
      color: #000;
      a {
        color: #000;
      }
    }
    li {
      line-height: 48px;
      &:first-child {
        margin-top: 20px;
      }
      cursor: pointer;
      &:hover {
        color: #3f8ffa;
      }
      a:hover {
        color: #3f8ffa;
      }
      .arrows {
        position: absolute;
        right: 0px;
        margin-top: 14px;
      }
      .icon-arrows {
        position: absolute;
        margin: 11.5px 8px 0 -20%;
      }
    }
    .guanli a {
      display: inline-block;
      width: 100%;
      height: 100%;
      color: #a1a1a1;
    }
    .guanli a:hover {
      color: #fff;
    }
  }
  ul li:last-child {
    border-bottom: none;
  }
  .aside-content {
    position: relative;
    ul {
      li {
        padding-left: 60px;
      }
    }
  }
  .aside-content a:after {
    display: inline-block;
    position: absolute;
    right: 8%;
    top: 3px;
  }
  .aside-content i {
    font-size: 19px;
    position: absolute;
    left: 15%;
    // &:hover{
    //   color:#3f8ffa;
    // }
  }
  .aside-content .icon-label {
    font-size: 23px;
  }
  .aside-content .icon-warning {
    font-size: 30px;
    left: 13%;
  }
  .aside-content .icon-model {
    font-size: 25px;
    left: 13%;
  }
  .aside-content a {
    display: inline-block;
    width: 100%;
    padding-left: 70px;
    box-sizing: border-box;
  }
}
</style>



// WEBPACK FOOTER //
// src/view/sysManage/aside.vue